package com.xiaoy.core.workflow.action;

import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Results;

import com.xiaoy.core.workflow.engine.entity.InstanceProcessVO;
import com.xiaoy.core.workflow.engine.entity.ProcessInstantiate;

@Namespace("/bpm")
@Results( {
})
public class ProcessAction extends BpmBaseAction{
	
	private static final long serialVersionUID = 3315951264802709125L;
	
	
	private InstanceProcessVO process;
	
	public String start () {
		try {
			System.out.println("process-->"+process.getId()+"--"+process.getKey());
			ProcessInstantiate instance =  processInstanceService.startProcessInstance(process);
			request.setAttribute("instance", instance);
		}catch (Exception e) {
			e.printStackTrace();
		}
		return "start";
	}
	
	public String approval () {
		
		
		return "approval";
	}

	public InstanceProcessVO getProcess() {
		return process;
	}

	public void setProcess(InstanceProcessVO process) {
		this.process = process;
	}
	
	

}
